//
//  ViewController.m
//  ImagePicker
//
//  Created by csh on 16/4/13.
//  Copyright © 2016年 com.read. All rights reserved.
//
#import "ImagePicker.h"
#import <AssetsLibrary/AssetsLibrary.h>
#import "DVImagePicker.h"
#import "ViewController.h"
#import "DVImagePickerNavigationController.h"
#import "DemoViewController.h"
@interface ViewController ()<ImagePickerDelegate,DVImagePickerNavigationControllerDelegate>
@property (nonatomic,strong)ImagePicker *imagePicker;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.imagePicker = [[ImagePicker alloc]initWithDelegate:self];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    DVImagePickerNavigationController *nav=[[DVImagePickerNavigationController alloc]initWithArray:nil];
    nav.responder=self;
    [self presentViewController:nav animated:YES completion:nil];
}

- (void)didChooseImages:(NSMutableArray *)images assets:(NSMutableArray *)assets sourceVC:(DVImagePickerNavigationController *)vc
{
//    NSLog(@"%d",images.count);
    DemoViewController *demo=[[DemoViewController alloc]init];
    demo.images=images;
    UINavigationController *nav=[[UINavigationController alloc]initWithRootViewController:demo];
    [vc dismissViewControllerAnimated:YES completion:^{
        [self presentViewController:nav animated:YES completion:nil];
    }];
}


@end
